<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="/common/common.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <!-- 验证码对齐样式 -->
    <style type="text/css">
        img{
            vertical-align:middle;
        }

    </style>

    <script type="text/javascript">
        function logen(){
            $.ajax({
                url:"/logenController/listGet",
                data:$("#logGetInfo").serialize(),
                dataType:"json",
                type:"post",
                success:function(result){
                    if(result.code == true){
                        toastr.success(result.message);
                        location.href="/permissionsController/list"
                    }else if(result.code ==false){
                        toastr.error(result.message);
                    }
                },
                error:function(){

                }
            })

        }

        function changeImg(obj){
            /!* 验证码时间搓 *!/
            obj.src="/code/vcode?time="+ new Date().getTime();
        }
    </script>
</head>
<body class="bg-info">
<form class="form-horizontal" role="form" id="logGetInfo">
    <br><br><br><br><br><br>
    <div class="form-group">
        <label for="uname" class="col-sm-4 control-label">用户名</label>
        <div class="col-sm-5">
            <input type="text" class="form-control" id="uname" name="uname" placeholder="请输入名字">
        </div>
        <div class="col-sm-3"></div>
    </div>
    <div class="form-group">
        <label for="lastname" class="col-sm-4 control-label">密码</label>
        <div class="col-sm-5">
            <input type="password" class="form-control" id="lastname" name="password" placeholder="请输入密码">
        </div>
        <div class="col-sm-3"></div>
    </div>


    <div class="form-group">
        <label for="firstname" class="col-sm-4 control-label">验证码</label>
        <div class="col-sm-5">
            <input type="text" class="form-control" name="vcode" id="firstname" placeholder="请输入验证码">
        </div>
        <div class="col-sm-3">
            <img  src="<%=path %>/code/vcode" width="120px" height="30px" onclick="changeImg(this)">
        </div>
    </div>


    <div class="form-group">
        <div class="col-sm-offset-4 col-sm-8">
            <div class="checkbox">
                <label>
                    <input type="checkbox">请记住我
                </label>
            </div>
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-4 col-sm-8">
            <button type="button" class="btn btn-default btn-sm" value="登录" onclick="logen()">
                <span class="glyphicon glyphicon-user"></span> 登录
                <!--   <button type="button" class="btn btn-default btn-sm" value="注册" onclick="addIn()">
                 <span class="glyphicon glyphicon-user"></span> 注册 -->
            </button>
        </div>
    </div>
</form>
</body>
</html>